package example.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloWorldController {

    @RequestMapping("/hello")
    public ModelAndView helloWorld() {
       String message = "Hello World, Spring 3.2!";
       System.out.println(message);
       return new ModelAndView("view/hello", "message", message);
       //页面路径为/pages/view/hello.ftl，ftl为servlet-context中suffix，pages为servlet-context中templateLoaderPath
    }
}
